obj = require('./compile_sol.js')

//部署
account = '0xd6cc4024572ca10bffbb0d1802e1991608ad665f';
Web3 = require('web3');
web3 = new Web3();
web3.setProvider('http://localhost:8546');

var gasInfo = {from: account, gas: 1500, gasPrice: '1'};

myContract = new web3.eth.Contract(obj.abi);
myContract
    .deploy({data: '0x' + obj.bytecode, arguments: [["hello", "world", "abc"]]})
    .send(gasInfo)
    .on('transactionHash', function (transactionHash) {
        console.log("transactionHash: ", transactionHash)
    })
    .on('receipt', function (receipt) {
        console.log("receipt: ", receipt);
    })
    .then(myContractInstance => {
        console.log("contract addr: ", myContractInstance.options.address + " deploy success!!");

        console.log("contract event end");
    });

